//
//  UWHistoryCell.h
//  Urban Words
//
//  Created by sebastian on 2011-12-02.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol SectionHeaderViewDelegate;

@interface UWHistoryCell : UIView {
    CGFloat rowHeight;
    NSMutableArray *wordLabels;
    BOOL leftSide; // Left = 1, Right = 0
    UIColor *bubbleColor;
    BOOL touchCancelled;
    UILabel *selectedWord;
    id<SectionHeaderViewDelegate> parentTable;
    NSInteger section;
    int countX, countY;
    NSString *score;
    UILabel *explanation;
}

//@property (retain, nonatomic) UILabel *explanation;
@property (retain, nonatomic) UIView *arrow;
@property (assign) BOOL open;

- (id)initWithLeftOrRight:(BOOL)leftOrRight section:(NSInteger)sectionNumber delegate:(id <SectionHeaderViewDelegate>)delegate;
- (CGFloat)getRowHeight;
- (void)setWords:(NSArray *)wordlist score:(NSString *)scoreForWords;
- (void)makeExplanation:(UILabel *)wordLabel;
- (UILabel *)getExplanation;

@end



/*
 Protocol to be adopted by the section header's delegate; the section header tells its delegate when the section should be opened and closed.
 */
@protocol SectionHeaderViewDelegate <NSObject>

@optional
-(void)sectionHeaderView:(UWHistoryCell*)sectionHeaderView sectionOpened:(NSInteger)section;
-(void)sectionHeaderView:(UWHistoryCell*)sectionHeaderView sectionClosed:(NSInteger)section;

@end